<!DOCTYPE html>
<html>
<head>
    <title>XML Construction Example</title>
</head>
<body>
    <p>This example only works in Firefox 1.5+.</p>
    <script type="text/javascript;e4x=1">
    
        var employees = <employees/>;
        employees.employee.name = "Nicholas C. Zakas";
        employees.employee.@position = "Software Engineer";

        employees.employee +=   <employee position="Salesperson">
                                    <name>Jim Smith</name>
                                </employee>;
        
        alert(employees.toXMLString());

    </script>
</body>
</html>
